package br.com.single.publico;

import br.com.single.modelo.estoque.Mvmovimevenda;

import java.util.Date;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.dbre.RooDbManaged;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@Entity
@Table(schema = "publico",name = "cdclient")
@RooJavaBean
@RooToString
@RooJpaActiveRecord(versionField = "", table = "cdclient", schema = "publico")
@RooDbManaged(automaticallyDelete = true)
public class Cdclient {

	
	
	
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "codigoclient",columnDefinition="codigonumero")
    private Integer codigoclient;
	
	@OneToMany(mappedBy = "client")
    private Set<Mvmovimevenda> mvmovimevendas;

	@ManyToOne
    @JoinColumns({ @JoinColumn(name = "estadoclient", referencedColumnName = "codigoestado",columnDefinition="bpchar"), @JoinColumn(name = "codigocidadeclient", referencedColumnName = "codigocidade",columnDefinition="codigocidade") })
    private Cdcidade cdcidade;

	@ManyToOne
    @JoinColumns({ @JoinColumn(name = "estadocobran", referencedColumnName = "codigoestado",columnDefinition="bpchar"), @JoinColumn(name = "codigocidadecobran", referencedColumnName = "codigocidade") })
    private Cdcidade cdcidade1;

	@ManyToOne
    @JoinColumns({ @JoinColumn(name = "tabelac1", referencedColumnName = "codigotabela",columnDefinition="bpchar"), @JoinColumn(name = "tipoclient", referencedColumnName = "elementabela",columnDefinition="classisimple") })
    private Cditemtabelageneri cditemtabelageneri;

	@ManyToOne
    @JoinColumns({ @JoinColumn(name = "tabelaae", referencedColumnName = "codigotabela",columnDefinition="bpchar"), @JoinColumn(name = "atividclient", referencedColumnName = "elementabela",columnDefinition="classisimple") })
    private Cditemtabelageneri cditemtabelageneri1;

	@ManyToOne
    @JoinColumns({ @JoinColumn(name = "tabelapo", referencedColumnName = "codigotabela",columnDefinition="bpchar"), @JoinColumn(name = "porteclient", referencedColumnName = "elementabela",columnDefinition="classisimple") })
    private Cditemtabelageneri cditemtabelageneri2;

	@ManyToOne
    @JoinColumns({ @JoinColumn(name = "tabelaar", referencedColumnName = "codigotabela",columnDefinition="bpchar"), @JoinColumn(name = "areaclient", referencedColumnName = "elementabela",columnDefinition="classisimple") })
    private Cditemtabelageneri cditemtabelageneri3;

	@Column(name = "nomeclient",columnDefinition="nomegrande")
    @NotNull
    private String nomeclient;

	@Column(name = "fantasclient",columnDefinition="nomereduzi")
    @NotNull
    private String fantasclient;

	@Column(name = "statusclient",columnDefinition="bpchar")
    @NotNull
    private Character statusclient;

	@Column(name = "cnpjclient",columnDefinition="cnpj")
    private String cnpjclient;

	@Column(name = "ieclient",columnDefinition="ie")
    private String ieclient;

	@Column(name = "emissorg",columnDefinition="nomereduzi")
    private String emissorg;

	@Column(name = "datarg",columnDefinition="data")
	@DateTimeFormat(style="M-")
	private Date datarg;

	@Column(name = "logradclient",columnDefinition="lograd")
    private String logradclient;

	@Column(name = "numerologardclient",columnDefinition="numerolograd")
    private String numerologardclient;

	@Column(name = "complelogradclient",columnDefinition="nomereduzi")
    private String complelogradclient;

	@Column(name = "cepclient",columnDefinition="cep")
    private String cepclient;

	@Column(name = "bairroclient",columnDefinition="bairro")
    private String bairroclient;

	@Column(name = "cidadeclient",columnDefinition="cidade")
    private String cidadeclient;

	@Column(name = "contatclient",columnDefinition="contat")
    private String contatclient;

	@Column(name = "telefoclient",columnDefinition="fone")
    private String telefoclient;

	@Column(name = "telefoclient02",columnDefinition="fone")
    private String telefoclient02;

	@Column(name = "telefoclient03",columnDefinition="fone")
    private String telefoclient03;

	@Column(name = "celulaclient",columnDefinition="fone")
    private String celulaclient;

	@Column(name = "faxclient",columnDefinition="fone")
    private String faxclient;

	@Column(name = "emailclient",columnDefinition="email")
    private String emailclient;

	@Column(name = "siteclient",columnDefinition="email")
    private String siteclient;

	@Column(name = "logradcobran",columnDefinition="lograd")
    private String logradcobran;

	@Column(name = "numerologradcobran",columnDefinition="numerolograd")
    private String numerologradcobran;

	@Column(name = "complelogradcobran",columnDefinition="nomereduzi")
    private String complelogradcobran;

	@Column(name = "cepcobran",columnDefinition="cep")
    private String cepcobran;

	@Column(name = "bairrocobran",columnDefinition="bairro")
    private String bairrocobran;

	@Column(name = "cidadecobran",columnDefinition="cidade")
    private String cidadecobran;

	@Column(name = "ctbcodigo",columnDefinition="codigocontab")
    private String ctbcodigo;

	@Column(name = "ctbapendi",columnDefinition="apendicontab")
    private String ctbapendi;

	@Column(name = "observclient",columnDefinition="observ")
    private String observclient;

	@Column(name = "limitecredit",columnDefinition="valorsimple")
    private String limitecredit;

	public Set<Mvmovimevenda> getMvmovimevendas() {
        return mvmovimevendas;
    }

	public void setMvmovimevendas(Set<Mvmovimevenda> mvmovimevendas) {
        this.mvmovimevendas = mvmovimevendas;
    }

	public Cdcidade getCdcidade() {
        return cdcidade;
    }

	public void setCdcidade(Cdcidade cdcidade) {
        this.cdcidade = cdcidade;
    }

	public Cdcidade getCdcidade1() {
        return cdcidade1;
    }

	public void setCdcidade1(Cdcidade cdcidade1) {
        this.cdcidade1 = cdcidade1;
    }

	public Cditemtabelageneri getCditemtabelageneri() {
        return cditemtabelageneri;
    }

	public void setCditemtabelageneri(Cditemtabelageneri cditemtabelageneri) {
        this.cditemtabelageneri = cditemtabelageneri;
    }

	public Cditemtabelageneri getCditemtabelageneri1() {
        return cditemtabelageneri1;
    }

	public void setCditemtabelageneri1(Cditemtabelageneri cditemtabelageneri1) {
        this.cditemtabelageneri1 = cditemtabelageneri1;
    }

	public Cditemtabelageneri getCditemtabelageneri2() {
        return cditemtabelageneri2;
    }

	public void setCditemtabelageneri2(Cditemtabelageneri cditemtabelageneri2) {
        this.cditemtabelageneri2 = cditemtabelageneri2;
    }

	public Cditemtabelageneri getCditemtabelageneri3() {
        return cditemtabelageneri3;
    }

	public void setCditemtabelageneri3(Cditemtabelageneri cditemtabelageneri3) {
        this.cditemtabelageneri3 = cditemtabelageneri3;
    }

	public String getNomeclient() {
        return nomeclient;
    }

	public void setNomeclient(String nomeclient) {
        this.nomeclient = nomeclient;
    }

	public String getFantasclient() {
        return fantasclient;
    }

	public void setFantasclient(String fantasclient) {
        this.fantasclient = fantasclient;
    }

	public Character getStatusclient() {
        return statusclient;
    }

	public void setStatusclient(Character statusclient) {
        this.statusclient = statusclient;
    }

	public String getCnpjclient() {
        return cnpjclient;
    }

	public void setCnpjclient(String cnpjclient) {
        this.cnpjclient = cnpjclient;
    }

	public String getIeclient() {
        return ieclient;
    }

	public void setIeclient(String ieclient) {
        this.ieclient = ieclient;
    }

	public String getEmissorg() {
        return emissorg;
    }

	public void setEmissorg(String emissorg) {
        this.emissorg = emissorg;
    }

	public Date getDatarg() {
        return datarg;
    }

	public void setDatarg(Date datarg) {
        this.datarg = datarg;
    }

	public String getLogradclient() {
        return logradclient;
    }

	public void setLogradclient(String logradclient) {
        this.logradclient = logradclient;
    }

	public String getNumerologardclient() {
        return numerologardclient;
    }

	public void setNumerologardclient(String numerologardclient) {
        this.numerologardclient = numerologardclient;
    }

	public String getComplelogradclient() {
        return complelogradclient;
    }

	public void setComplelogradclient(String complelogradclient) {
        this.complelogradclient = complelogradclient;
    }

	public String getCepclient() {
        return cepclient;
    }

	public void setCepclient(String cepclient) {
        this.cepclient = cepclient;
    }

	public String getBairroclient() {
        return bairroclient;
    }

	public void setBairroclient(String bairroclient) {
        this.bairroclient = bairroclient;
    }

	public String getCidadeclient() {
        return cidadeclient;
    }

	public void setCidadeclient(String cidadeclient) {
        this.cidadeclient = cidadeclient;
    }

	public String getContatclient() {
        return contatclient;
    }

	public void setContatclient(String contatclient) {
        this.contatclient = contatclient;
    }

	public String getTelefoclient() {
        return telefoclient;
    }

	public void setTelefoclient(String telefoclient) {
        this.telefoclient = telefoclient;
    }

	public String getTelefoclient02() {
        return telefoclient02;
    }

	public void setTelefoclient02(String telefoclient02) {
        this.telefoclient02 = telefoclient02;
    }

	public String getTelefoclient03() {
        return telefoclient03;
    }

	public void setTelefoclient03(String telefoclient03) {
        this.telefoclient03 = telefoclient03;
    }

	public String getCelulaclient() {
        return celulaclient;
    }

	public void setCelulaclient(String celulaclient) {
        this.celulaclient = celulaclient;
    }

	public String getFaxclient() {
        return faxclient;
    }

	public void setFaxclient(String faxclient) {
        this.faxclient = faxclient;
    }

	public String getEmailclient() {
        return emailclient;
    }

	public void setEmailclient(String emailclient) {
        this.emailclient = emailclient;
    }

	public String getSiteclient() {
        return siteclient;
    }

	public void setSiteclient(String siteclient) {
        this.siteclient = siteclient;
    }

	public String getLogradcobran() {
        return logradcobran;
    }

	public void setLogradcobran(String logradcobran) {
        this.logradcobran = logradcobran;
    }

	public String getNumerologradcobran() {
        return numerologradcobran;
    }

	public void setNumerologradcobran(String numerologradcobran) {
        this.numerologradcobran = numerologradcobran;
    }

	public String getComplelogradcobran() {
        return complelogradcobran;
    }

	public void setComplelogradcobran(String complelogradcobran) {
        this.complelogradcobran = complelogradcobran;
    }

	public String getCepcobran() {
        return cepcobran;
    }

	public void setCepcobran(String cepcobran) {
        this.cepcobran = cepcobran;
    }

	public String getBairrocobran() {
        return bairrocobran;
    }

	public void setBairrocobran(String bairrocobran) {
        this.bairrocobran = bairrocobran;
    }

	public String getCidadecobran() {
        return cidadecobran;
    }

	public void setCidadecobran(String cidadecobran) {
        this.cidadecobran = cidadecobran;
    }

	public String getCtbcodigo() {
        return ctbcodigo;
    }

	public void setCtbcodigo(String ctbcodigo) {
        this.ctbcodigo = ctbcodigo;
    }

	public String getCtbapendi() {
        return ctbapendi;
    }

	public void setCtbapendi(String ctbapendi) {
        this.ctbapendi = ctbapendi;
    }

	public String getObservclient() {
        return observclient;
    }

	public void setObservclient(String observclient) {
        this.observclient = observclient;
    }

	public String getLimitecredit() {
        return limitecredit;
    }

	public void setLimitecredit(String limitecredit) {
        this.limitecredit = limitecredit;
    }

	

	public Integer getCodigoclient() {
        return this.codigoclient;
    }

	public void setCodigoclient(Integer id) {
        this.codigoclient = id;
    }
}
